import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
export const ROUTER_MENU: RouteRecordRaw[] = [
  {
    path: '/layout/my',
    meta: {
      title: '我的',
      icon: 'User'
    },
    component: () => import('@/views/layout/My/index.vue'),
  }, {
    path: '/layout/table',
    meta: {
      title: '表格',
      icon: 'Menu'
    },
    component: () => import('@/views/layout/Table/index.vue'),
  }, {
    path: '/layout/echart',
    meta: {
      title: '图表',
      icon: 'Grid'
    },
    component: () => import('@/views/layout/Echart/index.vue'),
    children: [
      {
        path: '/layout/echart/line',
        meta: {
          title: '折线图',
          icon: 'DataLine'
        },
        component: () => import('@/views/layout/Echart/line/index.vue'),
      }, {
        path: '/layout/echart/pie',
        meta: {
          title: '饼图',
          icon: 'PieChart'
        },
        component: () => import('@/views/layout/Echart/pie/index.vue'),
      }, {
        path: '/layout/echart/bar',
        meta: {
          title: '柱状图',
          icon: 'Histogram'
        },
        component: () => import('@/views/layout/Echart/bar/index.vue'),
      }, {
        path: '/layout/echart/scsj',
        meta: {
          title: '测试',
          icon: 'Refresh'
        },
        component: () => import('@/views/layout/Echart/scsj/index.vue'),
        children: [
          {
            path: '/layout/echart/scsj/top1',
            meta: {
              title: '测试1',
              icon: 'Refresh'
            },
            component: () => import('@/views/layout/Echart/scsj/top1/index.vue'),
          }, {
            path: '/layout/echart/scsj/top2',
            meta: {
              title: '测试2',
              icon: 'Refresh'
            },
            component: () => import('@/views/layout/Echart/scsj/top2/index.vue'),
          }, {
            path: '/layout/echart/scsj/top3',
            meta: {
              title: '测试3',
              icon: 'Refresh'
            },
            component: () => import('@/views/layout/Echart/scsj/top3/index.vue'),
          }
        ]
      }
    ]
  },
]
const ROUTER: RouteRecordRaw[] = [
  {
    path: '/',
    meta: {
      title: '默认'
    },
    redirect: '/login'
  },
  {
    path: '/login',
    meta: {
      title: '登录'
    },
    component: () => import('@/views/Login/index.vue')
  },
  {
    path: '/layout',
    meta: {
      title: '布局'
    },
    component: () => import('@/views/layout/index.vue'),
    children: ROUTER_MENU
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: ROUTER
})
export default router